<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title></title>
</head>
<style>
    .box{
        margin: 20px 20px;
        width: 500px;
        height: 400px;

    }
    .frame{
        padding: 10px 0;
    }
    .frame input[type="text"]{
        width: 300px;
        padding: 5px;
        height: 35px;
        outline: 0;
        border: 1px solid #C5C5C5;
    }
    .frame select{
        width: 300px;
        padding: 5px;
        outline: 0;
        height: 35px;
        border: 1px solid #c5c5c5;
    }
    label{
        display: block;
    }
    .btn{
        margin: 10px 0;
        padding: 0;
        width: 60%;
        text-align: right;
    }
    input.reset,input.query{
        border: 0;
        color: #fff;
        padding: 7px 20px;
        outline: 0;
    }
    input.reset{
        background-color: #ed9c28;
    }
    input.query{
        background-color: #009fcd;
    }
</style>
<body>
<div class="box">
  <form  id="formid" method="post" class="instruct_box w5c-form demo-form" id="form_id" method="post"  role="form" w5c-form-validate="vm.validateOptions" novalidate name="validateForm">
    <div class="frame">
        <label>设备地址</label>
        <input type="text" placeholder="请输入16位设备地址"  name="chargerId" />
    </div>
    <div class="frame">
        <label>设置标识</label>
        <input type="text" placeholder="请输入标识" name="serial_no"/>
        <input type="hidden"  id="queryOrSet" name="queryOrSet" value ="01">
        <input type="hidden"  id="queryOrSetParamType" name="queryOrSetParamType" value ="08">
    </div>
   </form>
       <div class="btn">
        <input type="button" name="" value="设置" class="set" id="set" onclick="data_btn()" data-dismiss="modal"/>
        <input type="button" name="" value="清空" class="reset" id="reset"/>
    </div>
</div>
</body>
<script>
    //    $('#query').on('click', function() {
    //        $.ajax({
    //            type : 'post',
    //            url : '',
    //            data : {},
    //            dataType : 'json',
    //            success : function(data) {
    //
    //            },
    //            error: function(){
    //                bootboxWindow.alert("指令下发失败!", null);
    //            }
    //        });
    //    });
function data_btn(){
   // $('#set').on('click',function(){
        $.ajax({
            type : 'post',
            url : '/cms/chargeControll/queryOrSetParam',
            data : $('#formid').serialize(),
            dataType : "json",
            async : false,
            success : function(data) {
                console.log(data);
                if (data.code == '200') {
                    bootboxWindow.alert("指令下发成功!", null);
                } else {
                    bootboxWindow.alert("指令下发失败!", null);
                }
            },
            error:function(){
                bootboxWindow.alert("不能连接服务器");
            }
        })
    //})
}
</script>
</html>